package com.anne.fish.model;

import com.anne.fish.model.BaseObject;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableComponent;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import javax.xml.bind.annotation.XmlRootElement;

import java.io.Serializable;

@Entity
@Table(name="friend_link",catalog="fish")
@Searchable
@XmlRootElement
public class FriendLink extends BaseObject implements Serializable {
    private Long id;
    private String name;
    private String url;
    private String logo;
    private String descrip;
    private boolean hideFlag;
    private Boolean wordlinkFlag;
    private Long posttime;
    private Long endtime;

    @Id @GeneratedValue(strategy=IDENTITY) @SearchableId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="name", nullable=false, length=30)
    @SearchableProperty
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="url", nullable=false)
    @SearchableProperty
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    
    @Column(name="logo", nullable=false)
    @SearchableProperty
    public String getLogo() {
        return this.logo;
    }
    
    public void setLogo(String logo) {
        this.logo = logo;
    }
    
    @Column(name="descrip", nullable=false)
    @SearchableProperty
    public String getDescrip() {
        return this.descrip;
    }
    
    public void setDescrip(String descrip) {
        this.descrip = descrip;
    }
    
    @Column(name="hide_flag", nullable=false)
    @SearchableProperty
    public boolean isHideFlag() {
        return this.hideFlag;
    }
    
    public void setHideFlag(boolean hideFlag) {
        this.hideFlag = hideFlag;
    }
    
    @Column(name="wordlink_flag")
    @SearchableProperty
    public Boolean getWordlinkFlag() {
        return this.wordlinkFlag;
    }
    
    public void setWordlinkFlag(Boolean wordlinkFlag) {
        this.wordlinkFlag = wordlinkFlag;
    }
    
    @Column(name="posttime", nullable=false)
    @SearchableProperty
    public Long getPosttime() {
        return this.posttime;
    }
    
    public void setPosttime(Long posttime) {
        this.posttime = posttime;
    }
    
    @Column(name="endtime", nullable=false)
    @SearchableProperty
    public Long getEndtime() {
        return this.endtime;
    }
    
    public void setEndtime(Long endtime) {
        this.endtime = endtime;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FriendLink pojo = (FriendLink) o;

        if (name != null ? !name.equals(pojo.name) : pojo.name != null) return false;
        if (url != null ? !url.equals(pojo.url) : pojo.url != null) return false;
        if (logo != null ? !logo.equals(pojo.logo) : pojo.logo != null) return false;
        if (descrip != null ? !descrip.equals(pojo.descrip) : pojo.descrip != null) return false;
        if (hideFlag != pojo.hideFlag) return false;
        if (wordlinkFlag != null ? !wordlinkFlag.equals(pojo.wordlinkFlag) : pojo.wordlinkFlag != null) return false;
        if (posttime != null ? !posttime.equals(pojo.posttime) : pojo.posttime != null) return false;
        if (endtime != null ? !endtime.equals(pojo.endtime) : pojo.endtime != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (name != null ? name.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (logo != null ? logo.hashCode() : 0);
        result = 31 * result + (descrip != null ? descrip.hashCode() : 0);
        result = 31 * result + (hideFlag ? 1 : 0);
        result = 31 * result + (wordlinkFlag != null ? wordlinkFlag.hashCode() : 0);
        result = 31 * result + (posttime != null ? posttime.hashCode() : 0);
        result = 31 * result + (endtime != null ? endtime.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("name").append("='").append(getName()).append("', ");
        sb.append("url").append("='").append(getUrl()).append("', ");
        sb.append("logo").append("='").append(getLogo()).append("', ");
        sb.append("descrip").append("='").append(getDescrip()).append("', ");
        sb.append("hideFlag").append("='").append(isHideFlag()).append("', ");
        sb.append("wordlinkFlag").append("='").append(getWordlinkFlag()).append("', ");
        sb.append("posttime").append("='").append(getPosttime()).append("', ");
        sb.append("endtime").append("='").append(getEndtime()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
